1. Technical Field
Present invention embodiments relate to copying database objects, and more specifically, to creating image copies of database objects based on information within database buffer pools.
2. Discussion of the Related Art
Enterprise database systems commonly rely on rapid backup of production level objects to ensure high availability. The backup or copy process can be disruptive since on-line database systems access the disk devices used for the backup or copy processes. In addition, some copy processing may be performed without allowing changes to the object being copied. In order to minimize disruption, the copy process should complete as rapidly as possible. This becomes more acute in a database-as-a-service deployment model since service level agreements (SLAs) for database users need to be satisfied. A disruption caused by copy processing could jeopardize online system performance and ultimately jeopardize the SLAs.
One common approach for creating full image copies of database objects copies the file (or dataset) representing the object from disk. However, this copy may reflect significantly stale data for on-line database systems. Data may be updated in a buffer pool, but not committed to disk for long durations. Although the copy may be rapid with only disruption to the disk device, the recovery process may be severely impacted by the stale copy since more database logs would need to be applied to the stale data. This may result in a failure to meet SLAs should recovery be required.
Another common approach reads the object sequentially into the database buffer pool and uses the data in the buffer pool to create the image copy. This creates a current image copy, but the copy process may be elongated due to inefficient use of the buffer pool. Pages from the object may already reside in the buffer pool when the image copy is started. By navigating sequentially through the object, active pages in the buffer pool may be processed to disk to free space in the buffer pool for earlier pages. When the active page that was removed from the buffer pool needs to be copied, the page is reloaded into the buffer pool before writing the page to the image copy. These extra input/output (I/O) steps may result in longer elapsed times for the image copy. In addition, if the number of active pages in the buffer pool is low relative to the object size, when the image copy process finishes, the buffer pool is filled with unused object pages. This temporarily disrupts database performance since the prior active working set gets reloaded back into the buffer pool.